package com.example.xunai.dto.request.conversation;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotNull;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ConversationQueryRequest {
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    private Integer page = 1;

    private Integer size = 20;

    private String sortBy = "updateTime";

    private String sortDirection = "DESC";

    public boolean isValid() {
        return userId != null && page != null && page > 0 && size != null && size > 0;
    }
}